﻿<UserControl x:Class="dotNails.UI.RemoveTables"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="526" Height="334">
    <!--Height="248" Width="440">-->

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles.xaml"/>
                <ResourceDictionary Source="VectorIcons.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid Margin="5 0 5 5">
        <Grid.RowDefinitions>
            <RowDefinition Height="45"/>
            <RowDefinition Height="25"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="60"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="160"/>
        </Grid.ColumnDefinitions>

        <Border Grid.ColumnSpan="2" Style="{StaticResource HeaderBorder}">
            <StackPanel Orientation="Horizontal">
                <Button Name="btnBack" Click="btnBack_Click" MinWidth="0" MinHeight="0" Width="20" Height="20" IsTabStop="false" Margin="10 0 0 0">
                    <Image Stretch="Fill" Source="{StaticResource iconBack}" Width="20" Height="20" />
                </Button>
                <TextBlock x:Name="TitleBar" Style="{StaticResource H1}"  />
            </StackPanel>
        </Border>

        <TextBlock Text="Tables" Style="{StaticResource SectionTitle}" Grid.Column="0" Grid.Row="1" />
        
        <CheckBox x:Name="chkSelectAllTables" Grid.Column="0" Grid.Row="2" Content="Select All" VerticalAlignment="Center" HorizontalAlignment="Left" Click="chkSelectAllTables_Click" />
        <CheckBox x:Name="chkSelectAllViews" Grid.Column="0" Grid.Row="2" Content="Select All" VerticalAlignment="Center" HorizontalAlignment="Left" Click="chkSelectAllViews_Click" Visibility="Hidden" />
        <CheckBox x:Name="chkSelectAllProcs" Grid.Column="0" Grid.Row="2" Content="Select All" VerticalAlignment="Center" HorizontalAlignment="Left" Click="chkSelectAllProcs_Click" Visibility="Hidden" />


        <!--<ListBox x:Name="Tables" SelectionMode="Extended" Grid.Column="0" Grid.Row="3" Grid.RowSpan="2" Margin="0 5 5 5" SelectionChanged="Tables_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>-->
        <TabControl Margin="0,0,0,0" Grid.Column="0" Grid.Row="3" Grid.RowSpan="2">
            <TabItem x:Name="tabTables" Header="Tables" GotFocus="tabTables_GotFocus">
                <ListBox x:Name="Tables" SelectionMode="Extended" Margin="0 0 0 0" SelectionChanged="Tables_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Name}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </TabItem>
            <TabItem x:Name="tabViews" Header="Views" GotFocus="tabViews_GotFocus">
                <ListBox x:Name="Views" SelectionMode="Extended" Margin="0 0 0 0" SelectionChanged="Views_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Name}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </TabItem>
            <TabItem x:Name="tabStoredProcs" Header="Stored Procs" GotFocus="tabStoredProcs_GotFocus">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <ListBox x:Name="StoredProcs" SelectionMode="Extended" Margin="0 0 0 0" SelectionChanged="Procs_SelectionChanged">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Name}"/>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <Control
						x:Name="busyAnimation" 
						Style="{StaticResource BusyAnimationStyle}"
						Width="{Binding Path=ActualWidth, ElementName=image}" 
						Height="{Binding Path=ActualHeight, ElementName=image}" 
						/>
                </Grid>
            </TabItem>
        </TabControl>

        <Button x:Name="btnRmove" 
                Content="Remove" 
                VerticalAlignment="Bottom"
                Click="btnRemove_Click" 
                FontSize="18"
                Grid.Column="1"
                Grid.Row="4"
                Margin="5"/>
    </Grid>
</UserControl>

